package cn.zb.zbrhback.auth.service.impl;

import cn.zb.zbrhback.auth.domain.Menu;
import cn.zb.zbrhback.auth.domain.MenuQuery;
import cn.zb.zbrhback.auth.mapper.MenuMapper;
import cn.zb.zbrhback.auth.service.IMenuService;
import cn.zb.zbrhback.basic.service.impl.BaseServiceImpl;
import cn.zb.zbrhback.basic.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class MenuServiceImpl extends BaseServiceImpl<Menu> implements IMenuService {
    @Resource
    private MenuMapper menuMapper;

    @Override
    public List<Long> getId() {
        return menuMapper.loadId();
    }

    @Override
    public List<Menu> getAllParentMenu() {
        return menuMapper.getAllParentMenu();
    }

    @Override
    public List<Menu> getEmployeeMenu(Long eid) {
        List<Menu> employeeMenu = menuMapper.getEmployeeMenu(eid);
        System.out.println("角色拥有菜单"+employeeMenu);
        return employeeMenu;
    }
}
